package com.android.BluethootChess.activity;

import com.android.BluethootChess.activity.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

public class StartingApplicationActivity extends Activity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.welcome);

		/*
		 * String IP="192.168.2.5"; Client c=new Client(1234,IP);
		 * c.sendString("e ok");
		 */
		// Server ser=new Server(1234);
		// ser.Start();
		ImageView patch = (ImageView) findViewById(R.id.imageView1);
		patch.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				Intent myIntent = new Intent(view.getContext(),
						WelcomeActivity.class);
				startActivity(myIntent);
				quitProcess();
			}
		});

		// welcomeTextView
		TextView welcomeTextView = (TextView) findViewById(R.id.welcomeTextView);
		welcomeTextView.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				Intent myIntent = new Intent(view.getContext(),
						WelcomeActivity.class);
				startActivity(myIntent);
				quitProcess();
			}
		});

	}

	private void quitProcess() {
		super.onDestroy();
		android.os.Process.killProcess(android.os.Process.myPid());
	}
}
